<template>
<!--	<view class="mark">-->
		<!-- <button class="button" type="primary" @click="toggle('center')"><text class="button-text">居中</text></button> -->
		<!-- 普通弹窗 -->
		<uni-popup ref="posterPopRef" type="center" :mask-click="true">
			<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
				<view class="cu-dialog">
					<swiper class="swiper" :indicator-dots="true" :autoplay="false" :interval="2000"
						indicator-color="rgba(0, 0, 0, 0.3)" indicator-active-color="#000000" :duration="1000" circular>
						<swiper-item class="swiper-item" v-for="(item,index) in List" :key="index">
							<view class="swiper-item-image">
								<view class="image-bg">
									<image :src="item.img1"></image>
									<view class="image-text">
										<image :src="item.img2" mode=""></image>
									</view>
									<view class="img-new-peop coupon1">
										<image :src="item.img3" mode="">
											<view class="coupon-text" v-if="item.id==1">
												<view class="title">
													新人洗车券
												</view>
												<view class="time">
													{{GetDateTime(180) +' ' + '23:59:00'}} 到期
												</view>
											</view>
											<view class="coupon-fuel-text" v-if="item.id!=1">
												<view class="left">
													<view class="price">
														￥<text>{{item.id==2?'8':'3'}}</text>
													</view>
													<view class="full-reduction">
														{{item.id==2?'满100元可用':'满10元可用'}}
													</view>
												</view>
												<view class="right">
													<view class="title">
														{{item.id==2?'8元新人加油券':'3元新人充电券'}}
													</view>
													<view class="time">
														{{GetDateTime(180) +' ' + '23:59:00'}} 到期
													</view>
												</view>
											</view>
										</image>
									</view>
									<view class="img-new-peop coupon2">
										<image :src="item.img3" mode="">
											<view class="coupon-text" v-if="item.id==1">
												<view class="title">
													新人洗车券
												</view>
												<view class="time">
													{{GetDateTime(180) +' ' + '23:59:00'}} 到期
												</view>
											</view>
											<view class="coupon-fuel-text" v-if="item.id!=1">
												<view class="left">
													<view class="price">
														￥<text>{{item.id==2?'5':'3'}}</text>
													</view>
													<view class="full-reduction">
														{{item.id==2?'满100元可用':'满10元可用'}}
													</view>
												</view>
												<view class="right">
													<view class="title">
														{{item.id==2?'5元新人加油券':'3元新人充电券'}}
													</view>
													<view class="time">
														{{GetDateTime(180) +' ' + '23:59:00'}} 到期
													</view>
												</view>
											</view>
										</image>
									</view>
									<view class="img-new-peop coupon3">
										<image :src="item.img3" mode="">
											<view class="coupon-text" v-if="item.id==1">
												<view class="title">
													新人洗车券
												</view>
												<view class="time">
													{{GetDateTime(180) +' ' + '23:59:00'}} 到期
												</view>
											</view>
											<view class="coupon-fuel-text" v-else>
												<view class="left">
													<view class="price">
														￥<text>{{item.id==2?'3':'2'}}</text>
													</view>
													<view class="full-reduction">
														{{item.id==2?'满100元可用':'满10元可用'}}
													</view>
												</view>
												<view class="right">
													<view class="title">
														{{item.id==2?'3元新人加油券':'2元新人充电券'}}
													</view>
													<view class="time">
														{{GetDateTime(180) +' ' + '23:59:00'}} 到期
													</view>
												</view>
											</view>
										</image>
									</view>
									<view class="image-btn img-new-peop" @click="hideModal">
										去使用
									</view>
									<text class="memo img-new-peop">
										已自动发放卡券账户
									</text>
								</view>
							</view>
						</swiper-item>
					</swiper>
					<image @tap="hideModal" class="close-item" src="http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-close-bg.png"
						mode=""></image>
				</view>
			</view>
		</uni-popup>
<!--	</view>-->
</template>


<script>
	import {GetDateTime} from '@/utils/common.js'
	export default {
		name: "poster",
		data() {
			return {
				modalName: false,
        // posterRef: '',
				List: [
					{
						id: 1,
						img1: 'https://s11.ax1x.com/2024/02/26/pFaTTpQ.png',
						img2: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-text.png',
						img3: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-dal.png'
					},
					{
						id: 2,
						img1: 'https://s11.ax1x.com/2024/02/26/pFaTTpQ.png',
						img2: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-fuel-text.png',
						img3: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-fuel-dal.png'
					},
					{
						id: 3,
						img1: 'https://s11.ax1x.com/2024/02/26/pFaTTpQ.png',
						img2: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-charge-text.png',
						img3: 'http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-fuel-dal.png',
					}
				],
				type: 'center',
			};
		},
    onShow(){
    },
		methods: {
			GetDateTime,
			hideModal(e) {
				this.$refs.posterPopRef.close()
			},
			toggle(type) {
				this.type = type
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.posterPopRef.open(type)
			},
		}
	}
</script>

<style lang="scss" scoped>
	.mark {
		position: fixed;
    width: 100%;
		height: 100vh;
		color: #fff;
		background: rgba(0, 0, 0, 0.4);
    top: 0;
		left: 0;
		//margin-top: -848rpx;
		font-size: 26rpx;
		text-align: center;
		box-shadow: 2px -3px 100px -5px #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
	}

	.popup-content {
		.cu-dialog {
			position: relative;

			.swiper {

				// width: 320rpx;
				// min-height: 500rpx;
				width: 600rpx;
				height: 985rpx;

				.swiper-item {
					.swiper-item-image {
						position: relative;

						.image-bg {
							position: relative;

							image {
								width: 600rpx;
								height: 900rpx;
							}

							.image-text {
								position: absolute;
								top: 200rpx;
								left: 0px;
								right: 0px;
								margin: auto;
								width: 507rpx;
								height: 56rpx;

								image {
									width: 100%;
									height: 100%;
								}
							}

							.img-new-peop {
								position: absolute;
								left: 0px;
								right: 0px;
								margin: auto;
								width: 537rpx;
								height: 130rpx;

								image {
									width: 100%;
									height: 100%;
								}
							}

							.coupon1 {
								top: 270rpx;
							}

							.coupon2 {
								top: 420rpx;
							}

							.coupon1,
							.coupon2, 
							.coupon3{
								.coupon-text {
									position: absolute;
									left: 36rpx;
									top: 23rpx;

									.title {
										font-size: 32rpx;
										color: #2D2B2A;
										line-height: 50rpx;
									}

									.time {
										font-size: 24rpx;
										color: #666260;
										line-height: 36rpx;
									}
								}

								.coupon-fuel-text {
									position: absolute;
									top: 23rpx;
									display: flex;
									justify-content: space-around;
									width: 100%;

									.left {
										width: 25%;
										.price {
											margin-left: 15rpx;
											display: flex;
											color: #E56646;
											text {
												font-size: 70rpx;
											}
										}
										.full-reduction {
											margin-top: 10rpx;
											font-size: 22rpx;
											color: #E56646;
										}
									}
									.right {
										.title {
											font-size: 32rpx;
											color: #2D2B2A;
										}

										.time {
											font-size: 24rpx;
											color: #666260;
										}
									}
								}
							}

							.coupon3 {
								top: 570rpx;
							}

							.image-btn {
								top: 730rpx;
								width: 537rpx;
								height: 96rpx;
								background: url('http://wx.xiongmaovip.com/miniapp/static/personal-center/coupon-btn.png') no-repeat;
								background-size: 537rpx 96rpx;
								text-align: center;
								line-height: 96rpx;
								font-size: 40rpx;
								color: #E56646;
								font-style: normal;
								text-transform: none;
							}

							.memo {
								top: 835rpx;
								font-size: 26rpx;
								color: #FFFFFF;
								text-align: center;
							}

						}
					}
				}
			}

			.close-item {
				position: absolute;
				right: 0;
				bottom: -50rpx;
				left: 0;
				margin: auto;
				height: 80rpx;
				width: 80rpx;
			}
		}
	}

	.cu-form-group .title {
		min-width: calc(4em + 15px);
	}

	.btn-submit {
		background-color: #1C2A86;
		margin: 100upx 20upx;
		color: #fff;
	}
</style>